package org.example;

import org.example.pojo2.Person;
import org.junit.Before;
import org.junit.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Springtest2 {
    private ClassPathXmlApplicationContext context;
    @Before
    public void setUp() throws Exception {
        context = new ClassPathXmlApplicationContext("applicationContext2.xml");
    }

    @Test
    public void test() {
        Person person = (Person) context.getBean("person");
        System.out.println(person);
        Person person2 = (Person) context.getBean("person");
        System.out.println(person2);
        System.out.println(person==person2);
    }
}
